package com.woniuxy.listener;

import com.woniuxy.service.QuartzService;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @BelongsProject: community
 * @BelongsPackage: com.woniuxy.listener
 * @Author: Quan
 * @Date: 2025/3/4 20:14
 */
@Component
public class StartListener implements ApplicationListener<ApplicationStartedEvent> {
	@Autowired
	QuartzService quartzService;

	@SneakyThrows
	@Override
	public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) {
		quartzService.createJob();
	}
}
